package com.kinggm.service.decorator.io;

import java.io.FilterInputStream;
import java.io.InputStream;

public class LowerCaseInputStream extends FilterInputStream {
    protected LowerCaseInputStream(InputStream in) {
        super(in);
    }


    public int read() throws java.io.IOException {
        int c = super.read();
        return (c == -1 ? c : Character.toLowerCase((char)c));
    }

    public int read(byte[] b, int off, int len) throws java.io.IOException {
        int c = super.read(b, off, len);
        if (c != -1) {
            for (int i = off; i < off + c; i++) {
                b[i] = (byte)Character.toLowerCase((char)b[i]);
            }
        }
        return c;
    }


}
